jade.mtp.iiop
Class MessageTransportProtocol

java.lang.Object
  |
  +--jade.mtp.iiop.MessageTransportProtocol

public class MessageTransportProtocol
extends java.lang.Object
implements MTP

Implementation of fipa.mts.mtp.iiop.std specification for delivering ACL messages over the OMG IIOP transport protocol.

Author:
Giovanni Rimassa - Universita` di Parma

Inner classes inherited from class jade.mtp.InChannel
InChannel.Dispatcher
 
Constructor Summary
MessageTransportProtocol()
           
 
Method Summary
 TransportAddress activate(InChannel.Dispatcher disp)
          Activates an MTP handler for incoming messages on a default address.
 void activate(InChannel.Dispatcher disp, TransportAddress ta)
          Activates an MTP handler for incoming messages on a specific address.
 java.lang.String addrToStr(TransportAddress ta)
          Converts a TransportAddress object into a string representation.
 void deactivate()
          Deactivates all the MTP handlers.
 void deactivate(TransportAddress ta)
          Deactivates the MTP handler listening at a given transport address.
 void deliver(java.lang.String addr, Envelope env, byte[] payload)
          Delivers to the specified address an ACL message, encoded in some concrete message representation, using the given envelope as a transmission header.
 java.lang.String getName()
          Reads the name of the message transport protocol managed by this MTP.
 TransportAddress strToAddr(java.lang.String rep)
          Converts a string representing a valid address in this MTP to a TransportAddress object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageTransportProtocol

public MessageTransportProtocol()
Method Detail

activate

public TransportAddress activate(InChannel.Dispatcher disp)
                          throws MTPException
Description copied from interface: InChannel
Activates an MTP handler for incoming messages on a default address.
Tags copied from interface: InChannel
Returns:
A TransportAddress, corresponding to the chosen default address.
Throws:
MTPException - Thrown if some MTP initialization error occurs.

activate

public void activate(InChannel.Dispatcher disp,
                     TransportAddress ta)
              throws MTPException
Description copied from interface: InChannel
Activates an MTP handler for incoming messages on a specific address.
Tags copied from interface: InChannel
Parameters:
ta - A TransportAddress object, representing the transport address to listen to.
Throws:
MTPException - Thrown if some MTP initialization error occurs.

deactivate

public void deactivate(TransportAddress ta)
                throws MTPException
Description copied from interface: InChannel
Deactivates the MTP handler listening at a given transport address.
Tags copied from interface: InChannel
Parameters:
ta - The TransportAddress object the handle to close is listening to.
Throws:
MTPException - Thrown if some MTP cleanup error occurs.

deactivate

public void deactivate()
                throws MTPException
Description copied from interface: InChannel
Deactivates all the MTP handlers.
Tags copied from interface: InChannel
Throws:
MTPException - Thrown if some MTP cleanup error occurs.

deliver

public void deliver(java.lang.String addr,
                    Envelope env,
                    byte[] payload)
             throws MTPException
Description copied from interface: OutChannel
Delivers to the specified address an ACL message, encoded in some concrete message representation, using the given envelope as a transmission header.
Tags copied from interface: OutChannel
Parameters:
ta - The transport address to deliver the message to. It must be a valid address for this MTP.
env - The message envelope, containing various fields related to message recipients, encoding, and timestamping.
Throws:
MTPException - Thrown if some MTP delivery error occurs.

strToAddr

public TransportAddress strToAddr(java.lang.String rep)
                           throws MTPException
Description copied from interface: MTP
Converts a string representing a valid address in this MTP to a TransportAddress object.
Specified by:
strToAddr in interface MTP
Tags copied from interface: MTP
Parameters:
rep - The string representation of the address.
Returns:
A TransportAddress object, created from the given string.
Throws:
MTPException - If the given string is not a valid address according to this MTP.

addrToStr

public java.lang.String addrToStr(TransportAddress ta)
                           throws MTPException
Description copied from interface: MTP
Converts a TransportAddress object into a string representation.
Specified by:
addrToStr in interface MTP
Tags copied from interface: MTP
Parameters:
ta - The TransportAddress object.
Returns:
A string representing the given address.
Throws:
MTPException - If the given TransportAddress is not a valid address for this MTP.

getName

public java.lang.String getName()
Description copied from interface: MTP
Reads the name of the message transport protocol managed by this MTP. The FIPA standard message transport protocols have a name starting with "fipa.mts.mtp".
Specified by:
getName in interface MTP
Tags copied from interface: MTP
Returns:
A string, that is the name of this MTP.